package com.scau.database.entity.aftersale;

import com.scau.database.enums.ResultCode;
import lombok.Getter;

/**
 * @ClassName: ResultVO
 * @Description: TODO 统一响应体
 * @Author: sunslikes
 * @Date: 2020/6/26 1:50
 * @Version: 1.0
 */
@Getter
public class ResultVO<T> {
    /**
     * 状态码
     */
    private int code;
    /**
     * 响应信息
     */
    private String msg;
    /**
     * 响应数据
     */
    private T data;

    public ResultVO(T data) {
        this(ResultCode.SUCCESS, data);
    }

    public ResultVO(ResultCode resultCode, T data) {
        this.code = resultCode.getCode();
        this.msg = resultCode.getMsg();
        this.data = data;
    }
}
